Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: add failed-to-succeeded-stats command #2798

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Jun 29, 2023

Fix #2779

@FrostyX
Copy link
Member Author

FrostyX commented Jun 29, 2023

how much time pass between failed job and first succeeded of the same NEVRA.

I think the same NEVRA probably isn't what you are interested in? Because I can bump the package version/release while fixing it.

So the script goes through every package and its builds. If any of them fails, it will find the next successful build of the same package (It doesn't care for NEVRA, it only cares for package.id) and compares their build.ended_on.

@xsuchy, I didn't exactly remember what you are going to use this for, but I know we talked about average/median time. I think this output might be more helpful. But I can change it any way you need.

I run this against the current production database dump, and the result looks like this:

failed-to-succeeded-stats

Which can be read as "In 367 cases, a new successful build was submitted before the failing one could even finish. 59 failures were fixed in seconds, 9210 builds were fixed within hours after they failed, etc. The time ranges are very much understandable from the script itself. I can add more of them if you need.

Lastly, I am ignoring all packages that have only one build, packages that never failed, packages that have never been fixed, etc.

@FrostyX FrostyX force-pushed the fail-to-success-stats branch 2 times, most recently from c2eeaf4 to 1d55828 Compare June 29, 2023 23:25
@xsuchy
Copy link
Member

xsuchy commented Jul 3, 2023

For the record here are few artifacts that Jakub created:

Statistics for Packit user only:
failed-to-succeeded-stats-packit (1)

Statistics for all users for 2021
failed-to-succeeded-stats-2021

Statistics for all users for 2022
failed-to-succeeded-stats

# .filter(models.Build.submitted_on <= end))

# Packit user
# query = query.filter(models.Copr.user_id==5576)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this, are the builds filtered via the Copr project owner? (or via the submitter of the build?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik the user_id in Copr model is only project owner since this model represents the project as a whole, not the individual builds. To filter builds according to submitter:

query = query.filter(models.Build.user_id=PACKIT_USER_ID)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly as @nikromen is saying.

@FrostyX FrostyX merged commit 656e392 into fedora-copr:main Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

measure the time between failed and suceeded build
5 participants